package com.sumainfor.wx.system.maket.controller.rentadviser;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.wx.system.maket.service.RdTenantTrailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * <p>
 *
 * <p>
 *
 * @author: zc
 * @create: 2019-08-19 19:12
 **/
@Controller
@RequestMapping("/RdTenantTrailController")
public class RdTenantTrailController {
    
    @Autowired
    RdTenantTrailService rdTenantTrailService;
    
    /**
     * 放弃跟踪
     * @author zhoucong
     * @data 2019/8/19
     * @Param 
     * @return 
     */
    @ResponseBody
    @PostMapping("/addTenantTrailAbandon")
    public JsonResult addTenantTrailAbandon (@RequestBody Map<String,Object> params) {
        return rdTenantTrailService.addTenantTrailAbandon(params);
    }

    /**
     * 新增跟踪状态
     */
    @ResponseBody
    @PostMapping("/addTenantTrail")
    public JsonResult addTenantTrail (@RequestBody Map<String,Object> params) {
        JsonResult result = new JsonResult();
        int count=rdTenantTrailService.addTenantTrail(params);
        if (count>0){
            result.putSuccess("新增成功");
        }else{
            result.putFailed("服务器繁忙");
        }
        return result;
    }
}
